﻿using System.Configuration;

namespace SPDeployer.Core.Config
{
    public class WebApplicationConfigurationElement : ConfigurationElement
    {
        [ConfigurationProperty(Definitions.WebApplications.NAME, IsKey = false, IsRequired = false)]
        public string Name
        {
            get { return this[Definitions.WebApplications.NAME].ToString(); }
            set { this[Definitions.WebApplications.NAME] = value; }
        }

        [ConfigurationProperty(Definitions.WebApplications.URL, IsRequired = true)]
        public string Url
        {
            get { return this[Definitions.WebApplications.URL].ToString(); }
            set { this[Definitions.WebApplications.URL] = value; }
        }

        [ConfigurationProperty(Definitions.SITES_COLLECTION, IsRequired = false)]
        public SiteConfigurationElementCollection Sites
        {
            get { return (SiteConfigurationElementCollection)this[Definitions.SITES_COLLECTION]; }
            set { this[Definitions.SITES_COLLECTION] = value; }
        }
    }
}
